import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
// 懒加载
const Home =()=>import ('../pages/Home/home')
const Category =()=>import ('../pages/Category/category')
const Cart =()=>import ('../pages/Cart/cart')
const Aboutus =()=>import ('../pages/Aboutus/aboutus')
const Detail = () => import('../pages/detail/Detail.vue')
const routes =[
  {
    path:'',
    redirect:'/home'
  },
  {
    path:'/home',
    component:Home
  },
  {
    path:'/category',
    component:Category
  },
  {
    path:'/cart',
    component:Cart
  },
  {
    path:'/aboutus',
    component:Aboutus
  },
  {
    path:'/detail',
    component:Detail
  }
]
const router = new Router({
  routes,
  mode:'history'
})
export default router